package com.jt.system.service;

import com.jt.system.dao.UserMapper;
import com.jt.system.pojo.User;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserMapper userMapper;
    @Override
    public User selectUserByUsername(String username) {

        return userMapper.selectUserByUsername(username);

    }

    @Override
    public List<String> selectUserPermissions(Long userId) {
        // 1）单表多次查询 :表不在一个数据库时

        // 2）多表嵌套查询
        // 3）多表关联查询
        return userMapper.selectUserPermissions(userId);
    }
}
